package com.trinity.orders.service.impl;

import com.trinity.orders.domain.XcOrdersGoods;
import com.trinity.orders.mapper.XcOrdersGoodsMapper;
import com.trinity.orders.service.IXcOrdersGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 订单详情Service业务层处理
 *
 * @author trinity
 * @date 2023-11-19
 */
@Service
public class XcOrdersGoodsServiceImpl implements IXcOrdersGoodsService
{
    @Autowired
    private XcOrdersGoodsMapper xcOrdersGoodsMapper;

    /**
     * 查询订单详情
     *
     * @param id 订单详情主键
     * @return 订单详情
     */
    @Override
    public XcOrdersGoods selectXcOrdersGoodsById(Long id)
    {
        return xcOrdersGoodsMapper.selectXcOrdersGoodsById(id);
    }

    /**
     * 查询订单详情列表
     *
     * @param xcOrdersGoods 订单详情
     * @return 订单详情
     */
    @Override
    public List<XcOrdersGoods> selectXcOrdersGoodsList(XcOrdersGoods xcOrdersGoods)
    {
        return xcOrdersGoodsMapper.selectXcOrdersGoodsList(xcOrdersGoods);
    }

    /**
     * 新增订单详情
     *
     * @param xcOrdersGoods 订单详情
     * @return 结果
     */
    @Override
    public int insertXcOrdersGoods(XcOrdersGoods xcOrdersGoods)
    {
        return xcOrdersGoodsMapper.insertXcOrdersGoods(xcOrdersGoods);
    }

    /**
     * 修改订单详情
     *
     * @param xcOrdersGoods 订单详情
     * @return 结果
     */
    @Override
    public int updateXcOrdersGoods(XcOrdersGoods xcOrdersGoods)
    {
        return xcOrdersGoodsMapper.updateXcOrdersGoods(xcOrdersGoods);
    }

    /**
     * 批量删除订单详情
     *
     * @param ids 需要删除的订单详情主键
     * @return 结果
     */
    @Override
    public int deleteXcOrdersGoodsByIds(Long[] ids)
    {
        return xcOrdersGoodsMapper.deleteXcOrdersGoodsByIds(ids);
    }

    /**
     * 删除订单详情信息
     *
     * @param id 订单详情主键
     * @return 结果
     */
    @Override
    public int deleteXcOrdersGoodsById(Long id)
    {
        return xcOrdersGoodsMapper.deleteXcOrdersGoodsById(id);
    }
}
